<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 引入调试控制台 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/eruda/3.3.0/eruda.min.js"></script>
    <script>
      eruda.init();
    </script>
  </head>
  <body>
    <h1>Hello World</h1>
    <button>测试事件</button>
    <button id="camera">调用相册</button>
    <button id="cameras">调用相机</button>
    <img src="" alt="照片" />
    <button name="zhendong">开启震动</button>
    <button name="ssq">获取省市区</button>

    <script>
      const button = document.querySelector("button");
      const cameraButton = document.querySelector("#camera");
      const cameraButtons = document.querySelector("#cameras");
      button.addEventListener("click", () => {
        mk.sayHi("测试一下注入的方法");
        console.log(window.mk);
        mk.removeUser();
      });
      cameraButton.addEventListener("click", async () => {
        const str = await mk.pickerPhoto();
        document.querySelector("img").src = `data:image/jpeg;base64,${str}`;
      });
      cameraButtons.addEventListener("click", async () => {
        const str = await mk.pickerCamera();
      });
      const zhendong = document.querySelector('[name="zhendong"]');
      zhendong.addEventListener("click", () => {
        mk.vibrator();
      });
      const ssq = document.querySelector('[name="ssq"]');
      ssq.addEventListener("click", () => {
        const province = mk.getAreaColumns();
        console.log(province);
      });
    </script>
  </body>
</html>
